package com.cxf.windex.scheduler;

import com.cxf.windex.service.impl.OrdersTaskImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @program: business_needs
 * @description: 审核任务
 * @author: chenxf
 * @create: 2018-11-09 09:27
 **/
@Slf4j
@Component
public class ReviewScheduler  {
  @Autowired
  private OrdersTaskImpl task;

  /**
   * 每天凌晨0：01分 审核订单
   * @throws Exception
   */
  @Scheduled(cron="0 01 0 * * ?")
  public synchronized void reviewOrderTask() throws Exception {
    task.doPlan(log);
  }
}
